home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / misc / sci / ephem_src_4_28.lha / screen.h < prev    next >
Text File  |  1992-04-17  |  6KB  |  238 lines

  1. /* screen layout details
  2.  *
  3.  * it looks better if the fields are drawn in some nice order so it you
  4.  * rearrange the fields, check the menu printing functions.
  5.  * NB: all row/col values are 1 based, with upper left at [1,1]
  6.  */
  7.  
  8. /* size of screen */
  9. #define    NR    24
  10. #define    NC    80
  11.  
  12. #define    ASPECT    (4./3.)    /* screen width to height dimensions ratio */
  13.  
  14. #define    GAP    6    /* gap between field name and value */
  15.  
  16. #define    COL1        1
  17. #define    COL2        27
  18. #define    COL3        44
  19. #define    COL4        61    /* calendar */
  20.  
  21. #define    R_PROMPT    1    /* prompt row */
  22. #define    C_PROMPT    COL1
  23.  
  24. #define    R_NEWCIR    2
  25. #define    C_NEWCIR    ((NC-17)/2) /* 17 is length of the message */
  26.  
  27. #define    R_TOP        3    /* first row of top menu items */
  28.  
  29. #define    R_TZN    (R_TOP+0)
  30. #define    C_TZN    COL1
  31. #define    R_LT    R_TZN
  32. #define    C_LT    (C_TZN+GAP-2)
  33. #define    R_LD    R_TZN
  34. #define    C_LD    (C_TZN+13)
  35.  
  36. #define    R_UT    (R_TOP+1)
  37. #define    C_UT    COL1
  38. #define    C_UTV    (C_UT+GAP-2)
  39. #define    R_UD    R_UT
  40. #define    C_UD    (C_UT+13)
  41.  
  42. #define    R_JD    (R_TOP+2)
  43. #define    C_JD    COL1
  44. #define    C_JDV    (C_JD+GAP+3)
  45.  
  46. #define    R_LST    (R_TOP)
  47. #define    C_LST    COL2
  48. #define    C_LSTV    (C_LST+GAP)
  49.  
  50. #define    R_LAT    (R_TOP+0)
  51. #define    C_LAT    COL3
  52. #define    C_LATV    (C_LAT+4)
  53.  
  54. #define    R_DAWN    (R_TOP+2)
  55. #define    C_DAWN    COL2
  56. #define    C_DAWNV    (C_DAWN+GAP+3)
  57.  
  58. #define    R_STPSZ    (R_TOP+7)
  59. #define    C_STPSZ    COL2
  60. #define    C_STPSZV (C_STPSZ+GAP-1)
  61.  
  62. #define    R_HEIGHT (R_TOP+2)
  63. #define    C_HEIGHT COL3
  64. #define    C_HEIGHTV (C_HEIGHT+GAP)
  65.  
  66. #define    R_PRES    (R_TOP+4)
  67. #define    C_PRES    COL3
  68. #define    C_PRESV    (C_PRES+GAP)
  69.  
  70. #define    R_WATCH    (R_TOP+3)
  71. #define    C_WATCH    COL1
  72.  
  73. #define    R_LISTING (R_TOP+4)
  74. #define    C_LISTING COL1
  75. #define    C_LISTINGV (C_LISTING+20)
  76.  
  77. #define    R_SRCH    (R_TOP+5)
  78. #define    C_SRCH    COL1
  79. #define    C_SRCHV    (C_SRCH+16)
  80.  
  81. #define    R_PLOT    (R_TOP+6)
  82. #define    C_PLOT    COL1
  83. #define    C_PLOTV (C_PLOT+20)
  84.  
  85. #define    R_ALTM    (R_TOP+7)
  86. #define    C_ALTM    COL1
  87. #define    C_ALTMV    (C_ALTM+10)
  88.  
  89. #define    R_TZONE    (R_TOP+5)
  90. #define    C_TZONE    COL3
  91. #define    C_TZONEV (C_TZONE+GAP-1)
  92.  
  93. #define    R_LONG    (R_TOP+1)
  94. #define    C_LONG    COL3
  95. #define    C_LONGV    (C_LONG+4)
  96.  
  97. #define    R_DUSK    (R_TOP+3)
  98. #define    C_DUSK    COL2
  99. #define    C_DUSKV    (C_DUSK+GAP+3)
  100.  
  101. #define    R_NSTEP (R_TOP+6)
  102. #define    C_NSTEP    COL2
  103. #define    C_NSTEPV (C_NSTEP+GAP)
  104.  
  105. #define    R_TEMP    (R_TOP+3)
  106. #define    C_TEMP    COL3
  107. #define    C_TEMPV    (C_TEMP+GAP)
  108.  
  109. #define    R_EPOCH        (R_TOP+6)
  110. #define    C_EPOCH        COL3
  111. #define    C_EPOCHV    (C_EPOCH+GAP)
  112.  
  113. #define    R_PAUSE (R_TOP+7)
  114. #define    C_PAUSE    COL3
  115. #define    C_PAUSEV (C_PAUSE+GAP)
  116.  
  117. #define    R_MNUDEP    (R_TOP+6)
  118. #define    C_MNUDEP    COL3
  119. #define    C_MNUDEPV    (C_EPOCH+GAP)
  120.  
  121. #define    R_LON    (R_TOP+4)
  122. #define    C_LON    COL2
  123. #define    C_LONV    (C_LON+GAP+3)
  124.  
  125. #define    R_CAL    R_TOP
  126. #define    C_CAL   COL4
  127.  
  128. /* planet rows */
  129. #define    R_PLANTAB    (R_TOP+9)
  130. #define    R_SUN        (R_PLANTAB+1)
  131. #define    R_MOON        (R_PLANTAB+2)
  132. #define    R_MERCURY    (R_PLANTAB+3)
  133. #define    R_VENUS        (R_PLANTAB+4)
  134. #define    R_MARS        (R_PLANTAB+5)
  135. #define    R_JUPITER    (R_PLANTAB+6)
  136. #define    R_SATURN    (R_PLANTAB+7)
  137. #define    R_URANUS    (R_PLANTAB+8)
  138. #define    R_NEPTUNE    (R_PLANTAB+9)
  139. #define    R_PLUTO        (R_PLANTAB+10)
  140. #define    R_OBJX        (R_PLANTAB+11)
  141. #define    R_OBJY        (R_PLANTAB+12)
  142.  
  143. #define    C_OBJ        1
  144. #define    C_CONSTEL    2
  145. #define    C_XTRA        3
  146.  
  147. /* menu 1 info table */
  148. #define    C_RA        4
  149. #define    C_DEC        12
  150. #define    C_AZ        19
  151. #define    C_ALT        26
  152. #define    C_HLONG        33
  153. #define    C_HLAT        40
  154. #define    C_EDIST        47
  155. #define C_SDIST     54
  156. #define    C_ELONG        61
  157. #define    C_SIZE        68
  158. #define    C_MAG        73
  159. #define    C_PHASE        78
  160.  
  161. /* menu 2 screen items */
  162. #define    C_RISETM    7
  163. #define    C_RISEAZ    18
  164. #define    C_TRANSTM    29
  165. #define    C_TRANSALT    40
  166. #define    C_SETTM        51
  167. #define    C_SETAZ        62
  168. #define    C_TUP        73
  169.  
  170. /* menu 3 items */
  171. #define    C_SUN        4
  172. #define    C_MOON        10
  173. #define    C_MERCURY    17
  174. #define    C_VENUS        23
  175. #define    C_MARS        30
  176. #define    C_JUPITER    36
  177. #define    C_SATURN    43
  178. #define    C_URANUS    49
  179. #define    C_NEPTUNE    56
  180. #define    C_PLUTO        62
  181. #define    C_OBJX        69
  182. #define    C_OBJY        75
  183.  
  184. /* menu for jupiter aux info items */
  185. #define    R_JCML        (R_TOP+10)
  186. #define    C_JCMLSI    43
  187. #define    C_JCMLSII    60
  188. #define    C_JMNAMES    9
  189. #define    C_JMX        28
  190. #define    C_JMY        43
  191. #define    C_JMZ        58
  192. #define    R_JMAP        23
  193. #define    C_JMAP        1
  194. #define    R_JCOLHDNGS    17
  195. #define    R_IO        (R_JCOLHDNGS+1)
  196. #define    R_EUROPA    (R_JCOLHDNGS+2)
  197. #define    R_GANYMEDE    (R_JCOLHDNGS+3)
  198. #define    R_CALLISTO    (R_JCOLHDNGS+4)
  199.  
  200. #define    PW    (NC-C_PROMPT+1)    /* total prompt line width */
  201.  
  202. /* macros to pack a row/col and menu selection flags all into 16-bits.
  203.  * (use this rather than a structure because we can compare them so easily.
  204.  * could use bit fields and a union, but then can't init them or use switch.)
  205.  * bit field defs: [15..13]=menu [12..11]=flags [10..0]=NC*row+column(0 based).
  206.  * see sel_fld.c.
  207.  * F_MNUX also used in main to manage which bottom menu is up.
  208.  */
  209. #define    F_MMNU        (0<<13)    /* field is on main menu (or on all menus) */
  210. #define    F_MNU1        (1<<13)    /* field is on menu 1 */
  211. #define    F_MNU2         (2<<13)    /* field is on menu 2 */
  212. #define    F_MNU3        (3<<13)    /* field is on menu 3 */
  213. #define    F_MNUJ        (4<<13)    /* field is on jupiter menu */
  214. #define    F_PLT        (1<<12)    /* field may be picked for plotting or listng */
  215. #define    F_CHG        (1<<11)    /* field may be picked for changing */
  216. #define    rcfpack(r,c,f)    ((f) | (((r)-1)*NC + ((c)-1)))
  217. #define    unpackr(p)    (((p) & 0x7ff)/NC+1)
  218. #define    unpackc(p)    (((p) & 0x7ff)%NC+1)
  219. #define    unpackrc(p)    ((p) & 0x7ff)
  220. #define    tstpackf(p,f)    (((p) & ((f)&0x1800)) && \
  221.             (((p)&0xe000) == ((f)&0xe000) || ((p)&0xe000) == F_MMNU))
  222.  
  223. /* additions to the planet defines from astro.h.
  224.  * must not conflict, and must fit in range 0..15.
  225.  */
  226. #define    SUN    (PLUTO+1)
  227. #define    MOON    (PLUTO+2)
  228. #define    OBJX    (PLUTO+3)    /* the user-defined object */
  229. #define    OBJY    (PLUTO+4)    /* the user-defined object */
  230. #define    NOBJ    (OBJY+1)    /* total number of objects */
  231.  
  232. #define    cntrl(x)    ((x) & 037)
  233. #define    QUIT        cntrl('d')    /* char to exit program */
  234. #define    HELP        '?'        /* char to give help message */
  235. #define    REDRAW        cntrl('l')    /* char to redraw (like vi) */
  236. #define    VERSION        cntrl('v')    /* char to display version number */
  237. #define    END        'q'        /* char to quit current mode */
  238.